#@laybase() 
#define main()

<div id="table">
 	<table id="rtable" class="table">
	</table>
</div>
<script src="/assets/js/bootstrap-table-export.js"></script>
<script>
	//$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);
	$(function(){
		$.ajax({
			type:"post",
			url:"/statis/jbjData",
			success:function(data){
				console.log(data)
				var datas=[],
					columns=[{checkbox:true}];
				for(var i=0;i<data.fields.length;i++){
					columns.push({
						field:data.fields[i],
						title:data.names[i],
						align:'center'
					})
				}
				for(var j=0;j<data.data.length;j++){
					var cellData={};
					datas.push(cellData);
					for(var i=0;i<data.fields.length;i++){
						cellData[data.fields[i]]=data.data[j][data.fields[i]];
					}
				}
				var op = {};
				op.columns = columns
				op.data = datas
				op.rowAttributes = function(row,index){
						return {"width":"auto","height":"20px"}
					}
				op.showColumns = "true"
				op.search = "true"
				op.showToggle = "true"
				op.pagination = "true"
				op.height = "600"
				op.clickToSelect = "true"
				op.showExport = "true"
				op.exportTypes = ["xml","excel","json"] 
				$("#rtable").bootstrapTable(op);
			}
		})
	})
</script>
#end